<%@ page import="java.sql.*" %>

<% Class.forName("oracle.jdbc.OracleDriver"); %>

<HTML>
    <HEAD>
        <TITLE>Product List </TITLE>
	<style>

	</style>

    </HEAD>

   <body background="bg3.jpg">


<h2 align = "center"><a href="home4.jsp" style="text-decoration:blink;"><b>Home</b></a>&nbsp;&nbsp;&nbsp;<a href="add4.jsp" style="text-decoration:blink;"><b>Add a product</b></a>&nbsp;&nbsp;&nbsp;<a href="hello.jsp" style="text-decoration:blink;"><b>Inventory</b></a>&nbsp;&nbsp;&nbsp;<a href="search4.jsp" style="text-decoration:blink;">search</a>&nbsp;&nbsp;&nbsp;<a href="abtus.jsp" style="text-decoration:blink;"><b>About Us</b></a></h2>
<h3 align ="right"><a href="login.jsp" style="text-decoration:blink;"><b>Logout</b></a></h3>


       <center> <H2>Product List </H2> </center>

        <% 
            Connection connection = DriverManager.getConnection(
                "jdbc:oracle:thin:@localhost:1521:xe", "SEPROJECT", "123456");

            Statement statement = connection.createStatement() ;
            ResultSet resultset = statement.executeQuery("select * from PRODUCT") ; 
        %>

<br><br> <br> <br><center>
        <TABLE BORDER="1">
            <TR>
                <TH>ID</TH>
                <TH>Category</TH>
                <TH>Name</TH>
                <TH>Description</TH>
                <TH>Stock Quantity</TH>
	<TH>Reorder Quantity</TH>
            </TR>
            <% while(resultset.next()){ %>
            <TR>
                <TD> <%= resultset.getString(1) %></td>
                <TD> <%= resultset.getString(2) %></TD>
                <TD> <%= resultset.getString(3) %></TD>
	<TD> <%= resultset.getString(4) %></TD>
	<TD> <%= resultset.getString(5) %></TD>
	<TD> <%= resultset.getString(6) %></TD>
               
            </TR>
            <% } %>
        </TABLE> <center>
    </BODY>
</HTML>